Page({
  data: {
    items: [
      {
        id: 1,
        name: "华硕笔记本电脑",
        location: "图书馆三楼阅览室",
        date: "2024-01-15",
        time: "14:30",
        status: "lost"
      },
      {
        id: 2,
        name: "AirPods Pro 耳机",
        location: "教学楼 A402",
        date: "2024-01-14",
        time: "16:45",
        status: "found"
      },
      {
        id: 3,
        name: "学生证",
        location: "食堂二楼",
        date: "2024-01-13",
        time: "12:20",
        status: "lost"
      },
      {
        id: 4,
        name: "虎牌保温杯",
        location: "体育馆",
        date: "2024-01-12",
        time: "15:10",
        status: "found"
      }
    ]
  },
  
  onLoad: function() {
    // 页面加载时执行
  },
  
  switchTab: function(e) {
    const tab = e.currentTarget.dataset.tab;
    this.setData({
      currentTab: parseInt(tab)
    });
  },
  
  navigateToDetail: function(e) {
    const id = e.currentTarget.dataset.id;
    const item = this.data.items.find(item => item.id === id);
    
    wx.navigateTo({
      url: `/packageDetail/pages/detail/detail?data=${encodeURIComponent(JSON.stringify(item))}`
    });
  }
});
